package com.vvv.myapiclientsdk.model.request;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @author vvv
 * @date 2023-10-17 14 01
 * discription
 */
@Data
public abstract class AbstractRequest {
    /**
     * 请求地址
     */
    private String url;
    /**
     * 接口id
     */
    private Long id;
    /**
     * 什么方法调用
     */
    private String method;

    /**
     * 自定义请求参数
     */
    private Map<String, Object> customizedParams = new HashMap<>();

    /**
     * get customized key value pairs
     * @return
     */
    @JsonAnyGetter
    public Map<String, Object> getCustomizedParams() {
        return customizedParams;
    }

    /**
     * set customized key value pairs
     * @param key
     * @param value
     */
    public void set(String key, Object value) {
        this.customizedParams.put(key, value);
    }
}
